import authRequest from 'supports/requests/authRequest'

export function getUser() {
  return authRequest('users/show')
}

export function updateUser(data) {
  return authRequest('users', { method: 'put', data: data })
}

export function getTeam(data) {
  return authRequest('users/team', { data: data })
}

export function getUserAccounts(data) {
  return authRequest('accounts', { data: data })
}

export function getUserBrokerages(data) {
  return authRequest('brokerages', { data: data })
}

export function getUserCoupons(data) {
  return authRequest('coupons', { data: data })
}

export function getUserCouponsDefault(data) {
  return authRequest('coupons/default', { data: data })
}

export function getInviteString(productId = null) {
  let url = productId ? 'invites/string/' + productId : 'invites/string'
  return authRequest(url)
}

export function userInfoUpdate(data) {
  return authRequest('users', {method: 'put', data: data})
}

export function userSetChildNickname(id,data) {
  return authRequest('users/set/child/' + id + '/nickname', {method: 'put', data: data})
}

export function userFromInviteCode(data) {
  return authRequest('users/from/invite/code', {data: data})
}

export function userFreeWithdrawsNum(data) {
  return authRequest('withdraws/free/fee')
}


